import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../page/Home/home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: {
      title: '首页'
    },
    component: Home
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
    },
    component: () => import('../page/login/index.vue')
  },
  {
    path: '/cart',
    name: 'cart',
    meta: {
      title: '购物车'
    },
    component: () => import('../page/car/index.vue')
  },
  {
    path: '/productDetail',
    name: 'productDetail',
    meta: {
      title: '物料详情'
    },
    component: () => import('../page/product/productDetail.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
